package com.example.camerademoexcercies1.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.example.camerademoexcercies1.R;
import com.example.camerademoexcercies1.tool.GetBitmap;

public class MyAlbumFragment extends Fragment {

    private String finalFile;

    public MyAlbumFragment(String finalFile) {
        this.finalFile = finalFile;
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//        核心方法 引入fragment
        View view = inflater.inflate(R.layout.album_fragment, container, false);
        ImageView imageView = view.findViewById(R.id.album_imageView);
        imageView.setImageBitmap(GetBitmap.getBitmap(finalFile));
        return view;
    }

}
